#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <stdlib.h>

int* getConcatenation(int* nums, int numsSize) {
    int* ans = (int*)malloc(sizeof(int) * numsSize * 2);
    int n = 0;
    for (int i = 0; i < 2; ++i)
    {
        for (int j = 0; j < numsSize; ++j)
        {
            ans[n] = nums[j];
            ++n;
        }
    }
    return ans;
}


int main()
{
    int nums[] = {1,2,1};
    int* p = NULL;
    int * a = getConcatenation(nums, 3, p);
    for (int i = 0; i < 6; ++i)
    {
        printf("%d", a[i]);
    }
	return 0;
}